/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.googlecode.jsimplemarket.model;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author Alexandru.Codescu
 */
@Entity
@Table(name = "observatii_spatiu_comercial")
@NamedQueries({
    @NamedQuery(
        name = "ObservatieSpatiuComercial.queryObservatiiByDay",
        query = "select o.dataCreare, o.observatie, o.utilizator.numeUtilizator "
                + "from ObservatieSpatiuComercial o "
                //+ "inner join o.utilizatori creatDe "
                + "where o.dataCreare > ?1 "
                + "order by o.dataCreare desc ")
})
public class ObservatieSpatiuComercial extends Observatie {
	private Utilizator utilizator;
	
	@ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "UTILIZATOR_ID")
    public Utilizator getUtilizator() {
        return utilizator;
    }

    public void setUtilizator(Utilizator utilizator) {
        this.utilizator = utilizator;
    }
}
